package valueObjects
{
	public class BillItem
	{
		
			public var product:Product;
			public var quantity:uint;
			public var subtotal:Number;
			public var isIncome:Boolean = true;		//true为进货单，false为出货单
			
			public function BillItem(product:Product, quantity:uint = 1, isIncome:Boolean = true)
			{
				this.product = product;
				this.quantity = quantity;
				this.isIncome = isIncome;
				if(this.isIncome)
					this.subtotal = product.priceOfOrigin * quantity;
					else
					this.subtotal = product.priceOfTrade * quantity;
			}
			public function recalc():void {
				if(this.isIncome)
					this.subtotal = product.priceOfOrigin * quantity;
					else
					this.subtotal = product.priceOfTrade * quantity;
			}

	}
}